//package org.tabularium.text.nlp;
//
//import java.io.File;
//
//import it.uniroma1.lcl.adw.ADW;
//import it.uniroma1.lcl.adw.DisambiguationMethod;
//import it.uniroma1.lcl.adw.LexicalItemType;
//import it.uniroma1.lcl.adw.comparison.SignatureComparison;
//import it.uniroma1.lcl.adw.comparison.WeightedOverlap;
//
//import org.tabularium.text.TermWeightVector;
//import org.tabularium.text.TextSimilarity;
//import org.tabularium.text.nlp.wordnet.jwi.JwiWordNet;
//
///**
// * In order to use this similarity follow these steps:
// * <pre>
// * 	(1) Download and extract the followings:
// *		- semantic signatures 
// *			http://lcl.uniroma1.it/adw/ppvs.30g.5k.tar.bz2
// *		- resources 
// *			http://lcl.uniroma1.it/adw/resources.tar.gz
// *
// *	(2) include the config folder as a src directory to your project.
// *
// *	(3) Set the paths to the above two directories: 
// *		- "wn30g.ppv.path" in adw.properties
// *		- "resources.folder" in jlt.properties
// * </pre>
// * @author fabiogasparetti
// *
// */
//public class AdwSimilarity implements TextSimilarity {
//	LexicalItemType srcTextType;  
//	LexicalItemType trgTextType;
//
//	//if lexical items has to be disambiguated
//	DisambiguationMethod disMethod;      
//
//	//measure for comparing semantic signatures
//	SignatureComparison measure; 	
//
//	ADW pipeLine;
//	
//	public AdwSimilarity() {
//		srcTextType = LexicalItemType.SURFACE;  
//		trgTextType = LexicalItemType.WORD_SENSE;
//
//		//if lexical items has to be disambiguated
//		disMethod = DisambiguationMethod.ALIGNMENT_BASED;      
//
//		//measure for comparing semantic signatures
//		measure = new WeightedOverlap(); 	
//		pipeLine = new ADW();
//	}
//	
//	@Override
//	public double similarity(String text1, String text2) {
//
//		double score = pipeLine.getPairSimilarity(text1, text2,
//		                        disMethod, measure,
//		                        srcTextType, trgTextType); 
//		return score;
//	}
//
//	@Override
//	public double similarity(TermWeightVector v1, TermWeightVector v2) {
//		String s1 = v1.toPlainString(false);
//		String s2 = v2.toPlainString(false);
//		return similarity(s1, s2);
//	}
//
//	public static void main(String args[]) throws Exception {
//		try {
//
//			
//			AdwSimilarity sim = new AdwSimilarity();
//
//			System.out.println("\n");
//			double d = sim
//					.similarity(
//							"Felix lands as a Cat 5: Hurricane Felix made landfall in Nicaragua this morning as a powerful Category 5 storm, the U.S. National Hurricane Center said. The storm also is hammering a part of the Honduras coast that includes hotels and expensive vacation homes. developing story.",
//							"Hurricane Felix made landfall with potentially disastrous rain and top wind speeds of 160 mph (260 kph) near the Nicaragua-Honduras border Tuesday morning, the U.S. National Hurricane Center said.");
//			System.out.println(d);
//			d = sim.similarity("house is white.", "house is black.");
//			System.out.println(d);
//			d = sim.similarity("house is white.",
//					"construction  is black.");
//			System.out.println(d);
//			d = sim
//					.similarity(
//							"Felix lands as a Cat 5: Hurricane Felix made landfall in Nicaragua this morning as a powerful Category 5 storm, the U.S. National Hurricane Center said. The storm also is hammering a part of the Honduras coast that includes hotels and expensive vacation homes. developing story.",
//							"Hurricane Felix made landfall with potentially disastrous rain and top wind speeds of 160 mph (260 kph) near the Nicaragua-Honduras border Tuesday morning, the U.S. National Hurricane Center said.");
//			System.out.println(d);
//			d = sim.similarity("house is white.",
//					"construction  is black.");
//			System.out.println(d);
//			d = sim.similarity(
//					"Troop Reduction Is Possible, Bush Says.",
//					"Hurricane Felix Battering Central America.");
//			System.out.println(d);
//			d = sim
//					.similarity(
//							" Suicide bombers kill 25 in Pakistan army stronghold.",
//							"RAWALPINDI (AFP)  Two suicide bombings Tuesday ripped through a military bus and a market near the Pakistani army's headquarters, killing 25 people in the latest attacks aimed at destabilising President Pervez Musharraf.");
//			System.out.println(d);
//			d = sim
//					.similarity(
//							" Suicide bombers kill 25 in Pakistan army stronghold.",
//							"Army spokesman Major General Waheed Arshad said a total of 25 people were killed and 68 were wounded in the blasts..");
//			System.out.println(d);
//			// sim.similarity("At the direction of top officials of the Spitzer
//			// administration, the state police created documents meant to cause
//			// political damage to Senate Majority Leader Joseph Bruno, Attorney
//			// General Andrew Cuomo said in a report ....", "U.S. 1000$");
//			System.out.println("\n");
//			/*
//			 * List l = tagger.tag("U.S. Senator Russell Feingold wants to
//			 * censure President Bush and possibly others in the Administration
//			 * over events leading up to Iraq and for the handling of the Iraq
//			 * War. That would be a terrible idea and a step backwards for the
//			 * United States."); Iterator iter = l.iterator();
//			 * 
//			 * while (iter.hasNext()) { Tag t = (Tag) iter.next();
//			 * System.out.println(t); }
//			 */
//		} catch (Exception ex) {
//			System.out.println(ex.toString());
//			ex.printStackTrace();
//		}
//	}
//
//}
